//
//  YJSearchTextField.h
//  CToolBox
//
//  Created by crj on 16/8/30.
//  Copyright © 2016年 oyf. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol YJSearchTextFieldDelegate <NSObject>

@optional

/**
 *  开始编辑
 */
- (void)searchTextFieldEditStart;

/**
 *  text改变时
 *
 *  @param text 改变后的text
 */
- (void)searchtextFieldEditingChanged:(NSString *)text;


/**
 *  编辑完成，开始搜索
 *
 *  @param text 编辑完后的text
 */
- (void)searchTextFieldEditComplete:(NSString *)text;

@end



@interface YJSearchTextField : UIView

@property (nonatomic, assign) id<YJSearchTextFieldDelegate> delegate;



/** UITextField 的 placeholder */
@property (nonatomic, copy) NSString *placeholder;

/** UITextField 的 text */
@property (nonatomic, copy) NSString *text;

/** 是否可编辑（NO:没有确认按钮 YES:有确认按钮）*/
@property (nonatomic, assign) BOOL isCanEdit;
/** 是否展示确认按钮 (isCanEdit为YES下) */
@property (nonatomic, assign) BOOL isShowSureBtn;

@property (nonatomic, strong) UIColor *viewBackgroundColor;

- (void)textFieldBecomeFirstResponder;

- (instancetype)initWithFrame:(CGRect)frame placeholder:(NSString *)placeholder isCanEdit:(BOOL)isCanEdit delegate:(id)delegate;

@end
